<?php

use yii\db\Migration;

class m170619_031233_create_guild_bank extends Migration
{

    public function up()
    {
        $tableOptions = null;
        if ($this->db->driverName === 'mysql') {
            $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=MyISAM';
        }

        $this->createTable('{{%guild_bank}}', [
            'id' => $this->primaryKey()->unsigned()->comment('自增id'),
            'bank_branch' => $this->string()->notNull()->comment('银行支行'),
            'bank_user' => $this->string(32)->notNull()->comment('银行卡户主'),
            'bank_card' => $this->string()->notNull()->comment('银行卡号'),
            'bank_guild' => $this->string()->defaultValue('')->comment('银行卡所属公会'),
        ], $tableOptions);
    }

    public function down()
    {
        $this->dropTable('{{%guild_bank}}');
    }
}
